package org.heydr.example.data;

import java.util.List;
import java.util.Set;

import org.heydr.data.ResourceEngine;
import org.heydr.entity.Info;
import org.heydr.entity.Site;
import org.heydr.entity.Task;
import org.heydr.entity.Url;
import org.heydr.example.service.RMIService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MyResourceEngine extends ResourceEngine{
	@Autowired
	private RMIService rmiService;
	
	@Override
	public List<Site> availableSites(){
		return rmiService.availableSites();
	}
	
	@Override
	public List<Url> availableUrls(int size) {
		List<Url> list = null;
		Task tasks = rmiService.availableTasks("",size);
		tasks.getUrls();
		return list;
	}
	
	@Override
	public void storeUrls(List<Url> urls) {
		rmiService.storeUrls(urls);
	}

	public void setDataService(RMIService dataService) {
		this.rmiService = dataService;
	}

	@Override
	public void finishedTasks(List<Url> urls) {
		rmiService.finishedTasks(urls);
	}

	@Override
	public void storeInfo(Info info) {
		// TODO Auto-generated method stub
		
	}


}
